package com.vast.common.core.domain;


import com.vast.common.constant.MessageCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

@ApiModel(value = "Result对象", description = "返回数据结果")
public class Result<T> {

	public static Result SUCCESS = new Result(MessageCode.SUCCESS);

	public static Result ERROR = new Result(MessageCode.ERROR);

	@ApiModelProperty(value = "状态码")
	private int code;
	@ApiModelProperty(value = "信息描述")
	private String msg = "";
	@ApiModelProperty(value = "数据结果")
	private T data;

	public Result() {
	}

	public Result(int code) {
		this.code = code;
	}

	public Result(int code, String msg) {
		this.code = code;
		this.msg = msg;
	}

	public Result(int code, T data) {
		this.code = code;
		this.data = data;
	}

	public Result(int code, String msg, T data) {
		this.code = code;
		this.msg = msg;
		this.data = data;
	}

	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public T getData() {
		return data;
	}

	public void setData(T data) {
		this.data = data;
	}

}
